package com.gitee.l0km.thrift.swift2thrift.generator;

import java.util.List;
import java.util.Map;

import com.beust.jcommander.Strings;
import com.facebook.swift.codec.metadata.ThriftType;
import com.facebook.swift.generator.swift2thrift.template.ThriftContext;
import com.facebook.swift.service.metadata.ThriftServiceMetadata;
import com.google.common.base.MoreObjects;

public class ThriftContextErpc extends ThriftContext {
	private final String programName;
	private final String portPrefix;
	private final int defaultMaxLength;
	private final int errmsgMaxLength;
	private final boolean erpcProxy;
	private final ThriftType erpcProxyReturnType;
	public ThriftContextErpc(String namespace, List<String> includes, List<ThriftType> thriftTypes,
			List<ThriftServiceMetadata> thriftServices, Map<String, String> namespaceMap, 
			String programName, String portPrefix, int defaultMaxLength, int errmsgMaxLength, 
			boolean erpcProxy, ThriftType erpcProxyReturnType) {
		super(namespace, includes, thriftTypes, thriftServices, namespaceMap);
		this.programName = Strings.isStringEmpty(programName) ? "UNKNOW_PROGRAM_NAME" : programName;
		this.portPrefix = MoreObjects.firstNonNull(portPrefix, "");
		this.defaultMaxLength = defaultMaxLength;
		this.errmsgMaxLength = errmsgMaxLength;
		this.erpcProxy = erpcProxy;
		this.erpcProxyReturnType = erpcProxyReturnType;
	}
	public String getProgramName() {
		return programName;
	}
	public String getPortPrefix() {
		return portPrefix;
	}
	/**
	 * @return defaultMaxLength
	 */
	public int getDefaultMaxLength() {
		return defaultMaxLength;
	}
	/**
	 * @return errmsgMaxLength
	 */
	public int getErrmsgMaxLength() {
		return errmsgMaxLength;
	}
	/**
	 * @return erpcProxy
	 */
	public boolean isErpcProxy() {
		return erpcProxy;
	}
	/**
	 * @return erpcProxyReturnType
	 */
	public ThriftType getErpcProxyReturnType() {
		return erpcProxyReturnType;
	}
	
}
